package cn.jhc.teachingquality.net.teaching;

import com.android.volley.AuthFailureError;
import com.android.volley.Response;

import org.jsoup.nodes.Document;

import java.util.HashMap;
import java.util.Map;

import cn.jhc.teachingquality.Global;
import cn.jhc.teachingquality.net.TeachingQualityRequest;

/**
 * 获取教学日志编辑表单的请求，从请求返回的表单中抽取出保存教学日志所需的信息。
 * Created by luyanfei on 16-4-16.
 */
public class TeachingLogDetailRequest extends TeachingQualityRequest<Map<String,Object>> {
    private static final String TEACHING_LOG_DETAIL_URL =
            Global.URL_PREFIX + "/pjJxrzAction!add.shtml";

    private String hiddenId;

    public TeachingLogDetailRequest(String hiddenId, Response.Listener<Map<String,Object>> listener) {
        super(Method.POST, TEACHING_LOG_DETAIL_URL, listener);
        this.hiddenId = hiddenId;
    }

    @Override
    protected Map<String,Object> handleResponse(Document document) {
        Map<String,Object> map = new HashMap<>();

        return map;
    }

    @Override
    protected Map<String, String> getParams() throws AuthFailureError {
        Map<String,String> map = new HashMap<>();
        map.put("id", hiddenId);
        map.put("pjJxrz.id", hiddenId);
        map.put("jcKcxx.id", hiddenId);
        return map;
    }
}
